const { resolve} = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin'); 
const CleanWebpackPlugin = require('clean-webpack-plugin');
const ProgressBarPlugin = require('progress-bar-webpack-plugin')
const webpack = require('webpack');
module.exports = {
entry: ['react-hot-loader/patch',
    './src/index.js'
],
output: {
    filename: '[name].js',
    path: resolve(__dirname, 'dist'),
},
module: {
    rules: [{
    test: /\.(jsx|js)$/,
    include: resolve(__dirname, "src"),  
    loader: "babel-loader",
    options: {
        presets: [
          'latest'
        ]
      }
    }]
},
plugins: [
    new CleanWebpackPlugin(['dist']),
    new HtmlWebpackPlugin({
    title: 'Output Management',
    template: resolve(__dirname, 'public/my-html.ejs')
    }),
    new ProgressBarPlugin()
],
};